package mr.zhang.service.impl;

import mr.zhang.dao.CustomerDao;
import mr.zhang.pojo.model.TCustomer;
import mr.zhang.service.CustomerService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * Created by jerry on 15/2/3.
 * E-mail:huaxinxc@me.com
 */
@Service("customerService")
public class CustomerServiceImpl implements CustomerService {

    public void setCustomerDao(CustomerDao customerDao) {
        this.customerDao = customerDao;
    }

    @Autowired
    private CustomerDao customerDao;





    /**
     * 获取客户列表
     *
     * @return
     */
    @Override
    public List<TCustomer> getCustomerList() {
        return customerDao.queryCustomerList();
    }

    /**
     * 添加客户资料
     *
     * @param customer
     * @return
     */
    @Override
    public void addCustomer(TCustomer customer) {

        // 由管理员后台录入
        customer.setCustomerPlay("后台录入");

         customerDao.addCustomer(customer);

    }
}
